﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using nRoute.Components;
using nRoute.Samples.Netflix.Data.Catalog;

namespace nRoute.Samples.Netflix.Views
{
    /// <summary>
    /// Interaction logic for PersonView.xaml
    /// </summary>
    public partial class PersonView : UserControl
    {
        public PersonView()
        {
            InitializeComponent();

            this.SetRelayConverter<IEnumerable<Title>, IEnumerable<Title>>("LimitListingConverter", 
                (l) => l == null ? null : l.Take(15));

            this.SetRelayConverter<IEnumerable<Title>, Visibility>("ListingVisibilityConverter",
                (l) => l == null || l.Count() == 0 ? Visibility.Collapsed : Visibility.Visible);
        }
    }
}
